package com.itheima.member;

import com.hzheima.util.ImageUtil;
import com.itheima.ExtendsClass.Fly;
import com.itheima.FinalCanstans;

public class Picture3 extends Fly {
    private  int xspeed;
    private  int yspeed;
    public Picture3() {
        img = ImageUtil.getImg("xx.png");
        //图片的宽度
        width = img.getWidth();
        //图片的高度
        hight = img.getHeight();
        //图片的位置
        x = 600;
        y = -hight;
        xspeed = 5;
        yspeed = 1;
    }

    public void moveStart(){
        x += xspeed;
        if (x >= FinalCanstans.APP_WIDTH){
            xspeed = -5;
        }
        if (x <= 0){
            xspeed =  5;
        }
        y += yspeed;
    }
}
